//
//  LeftTableViewCell.m
//  Linkage
//
//  Created by LeeJay on 16/8/22.
//  Copyright © 2016年 LeeJay. All rights reserved.
//  代码下载地址https://github.com/leejayID/Linkage

#import "LeftTableViewCell.h"

//#define defaultColor rgba(244, 124, 153, 1)

@interface LeftTableViewCell ()

@property (nonatomic, strong) UIView *pinkView;

@end

@implementation LeftTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        self.name = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 60, 40)];
        self.name.numberOfLines = 0;
        self.name.font = [UIFont systemFontOfSize:14];
//        self.name.textColor = rgba(130, 130, 130, 1);
//        self.name.highlightedTextColor = defaultColor;
        self.name.textColor = RGB(130, 130, 130);
        self.name.highlightedTextColor = UIMainColorRGB;
        [self.contentView addSubview:self.name];

        self.pinkView = [[UIView alloc] initWithFrame:CGRectMake(0, 5, 5, 45)];
        self.pinkView.backgroundColor = UIMainColorRGB;
        [self.contentView addSubview:self.pinkView];
        
//        UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, self.contentView.height-1, self.contentView.width, 1)];
//        [self.contentView addSubview:line];
//        line.backgroundColor = kGrayColor;
//        
//        UIView *line2 = [[UIView alloc] initWithFrame:CGRectMake(self.contentView.width-1, 0, 1, self.contentView.height)];
//        [self.contentView addSubview:line2];
//        line2.backgroundColor = kGrayColor;
        
//        self.contentView.layer.borderWidth = 1;
//        self.contentView.layer.borderColor = kLightGrayColor.CGColor;
        
    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    // Configure the view for the selected state

    self.contentView.backgroundColor = !selected ? [UIColor whiteColor] : UISeparatedColorRGB;
    self.highlighted = selected;
    self.name.highlighted = selected;
    self.pinkView.hidden = !selected;
}

@end
